Codelabs03 - For Loop 1 how to do this? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Codelabs03 - For Loop 1 how to do this?

Codelabs03 - For Loop 1. Binary Hexadecimal Converter App Description: You are responsible for writing a program that will generate binary and hexadecimal values from up to a specified user value. Recall that decimal is a base 10 number system, binary is a base 2 number system, and hexadecimal is a base 16 number system. Your program will use list slicing to first only show a portion of these values. Your program will then loop through the entire lists of decimal, binary, and hexadecimal values to show the relationship between numbers of different bases. Example Output: Welcome to the Binary/Hexadecimal Converter App Compute binary and hexadecimal values up to the following decimal number: 12 Generating lists....complete! Using slices, we will now show a portion of each list. What decimal number would you like to start at: 4 What decimal number would you like to stop at: 7 Decimal values from 4 to 7: 4 5 6 7 Binary values from 4 to 7: 0b100 0b101 0b110 0b111 Hexadecimal values f

26th Sep 2021, 8:15 AM
Jennicakrisha Luz
1 Resposta
+ 1
Day 1 One hour ago you started 4% into Data Science and you ask this? Well it seems there will be a for loop with a lower and upper boundary. There will also be some printing, maybe the following may help for i in range(4,8): print(bin(i)) print(hex(i)) But, I strongly suggest you learn to walk before you run, it hurts less. Spend some time doing the tutorials and get some basics going. Python for beginners is a good place to start
26th Sep 2021, 9:42 AM
Rik Wittkopp
Rik Wittkopp - avatar