Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Logical Operators | Conditional Statements
Introduction to Python
course content

Course Content

Introduction to Python

Introduction to Python

1. First Acquaintance
2. Variables and Types
3. Conditional Statements
4. Other Data Types
5. Loops
6. Functions

bookChallenge: Logical Operators

Task
test

Swipe to show code editor

You've been assigned a string variable t. Verify if both of these conditions are met:

  • The string's length is under 15 characters.
  • The count of the letter 'n' in this string exceeds 2.

Note

To count the number of occurrences of the letter 'n' in the string variable t, use the count method as follows: t.count('n').

You also have a numerical variable a. Determine if either of the following criteria is satisfied:

  • a is above 9475/37.
  • The remainder when dividing a by 14 is below 7.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 4
toggle bottom row

bookChallenge: Logical Operators

Task
test

Swipe to show code editor

You've been assigned a string variable t. Verify if both of these conditions are met:

  • The string's length is under 15 characters.
  • The count of the letter 'n' in this string exceeds 2.

Note

To count the number of occurrences of the letter 'n' in the string variable t, use the count method as follows: t.count('n').

You also have a numerical variable a. Determine if either of the following criteria is satisfied:

  • a is above 9475/37.
  • The remainder when dividing a by 14 is below 7.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 4
toggle bottom row

bookChallenge: Logical Operators

Task
test

Swipe to show code editor

You've been assigned a string variable t. Verify if both of these conditions are met:

  • The string's length is under 15 characters.
  • The count of the letter 'n' in this string exceeds 2.

Note

To count the number of occurrences of the letter 'n' in the string variable t, use the count method as follows: t.count('n').

You also have a numerical variable a. Determine if either of the following criteria is satisfied:

  • a is above 9475/37.
  • The remainder when dividing a by 14 is below 7.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Task
test

Swipe to show code editor

You've been assigned a string variable t. Verify if both of these conditions are met:

  • The string's length is under 15 characters.
  • The count of the letter 'n' in this string exceeds 2.

Note

To count the number of occurrences of the letter 'n' in the string variable t, use the count method as follows: t.count('n').

You also have a numerical variable a. Determine if either of the following criteria is satisfied:

  • a is above 9475/37.
  • The remainder when dividing a by 14 is below 7.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 3. Chapter 4
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt